package com.kevinxiaoge.ruoli.demo;

/**
 * @author chengyuanyuan
 */
public class OutClass {

    private OutClass() {}

    public static OutClass getInstance(){
        return InnerClass.outClass;
    }

    public static class InnerClass{
        private static OutClass outClass = new OutClass();
    }
}

class OutClassTest{
    public static void main(String[] args) {
        OutClass instance = OutClass.getInstance();
        OutClass instance1 = OutClass.getInstance();
        System.out.println(instance == instance1);
    }
}
